﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Sern.Abstracts.Common;

namespace RemotelyUploadableTest.Main
{
    public class Entry : MarshalByRefObject, IClientInstance
    {
        public void Initialize(ClientInitializationArgument arg)
        {
            //TODO: May be we can have it auto zip on compile.
            var directory = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory;
            File.WriteAllText(directory.FullName + "\\" + arg.ClientId, string.Join("|",arg.Keys.ToArray() + "\n" + string.Join("|", arg.Values.ToArray())));
        }

        public void Register()
        {
        }

        public void Deregister()
        {            
        }
    }
}
